package goleetcode

func makeSmallestPalindrome(s string) string {
	left, right := 0, len(s) - 1
	runes := []rune(s)
	for left < right {
		if runes[left] != runes[right] {
			tmp := min(runes[left], runes[right])
			runes[left] = tmp
			runes[right] = tmp
		}
		left++
		right--
	}
	return string(runes)
}